package cn.iocoder.yudao.module.hqchart.controller.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.List;

/**
 * <p>
 * HQChart-分时响应
 * </p>
 *
 * @author pokbrin
 * @date 2023-07-18 17:08
 */
@Data
@Schema(description = "HQChart - 分时响应 VO")
public class HQChartFenShiRespVO {

    @Schema(description = "股票代码", requiredMode = Schema.RequiredMode.REQUIRED, example = "000001")
    private String symbol;
    @Schema(description = "股票名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "平安银行")
    private String name;
    @Schema(description = "前收盘", requiredMode = Schema.RequiredMode.REQUIRED, example = "14.27")
    @JsonProperty("yclose")
    private BigDecimal preClose;
    @Schema(description = "开盘价", requiredMode = Schema.RequiredMode.REQUIRED, example = "14.28")
    private BigDecimal open;
    @Schema(description = "最新价", requiredMode = Schema.RequiredMode.REQUIRED, example = "14.28")
    private BigDecimal price;
    @Schema(description = "最高价", requiredMode = Schema.RequiredMode.REQUIRED, example = "14.28")
    private BigDecimal high;
    @Schema(description = "最低价", requiredMode = Schema.RequiredMode.REQUIRED, example = "14.28")
    private BigDecimal low;
    @Schema(description = "成交量(手)", requiredMode = Schema.RequiredMode.REQUIRED, example = "60903434")
    private Integer vol;
    @Schema(description = "成交金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "861177482")
    private BigDecimal amount;
    @Schema(description = "交易日期", requiredMode = Schema.RequiredMode.REQUIRED, example = "20230701")
    @JsonFormat(pattern = "yyyyMMdd")
    private LocalDate date;
    @Schema(description = "交易时间(HHmmss)", requiredMode = Schema.RequiredMode.REQUIRED, example = "104523")
    @JsonFormat(pattern = "HHmmss")
    private LocalTime time;
    @Schema(description = "分钟数据", requiredMode = Schema.RequiredMode.REQUIRED, example = "[]")
    private List<MinuteRespVO> minute;
    @Schema(description = "分钟数据个数", requiredMode = Schema.RequiredMode.REQUIRED, example = "23")
    @JsonProperty("minutecount")
    private Integer minuteCount;
    /**
     *
     */
    @Schema(description = "盘前集合竞价 (开启集合竞价才会请求这个字段）",
            requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "[交易时间(格式MMHHSS),价格,成交量,成交金额,日期(可选,YYYYMMDD)]")
    private List<String> before;

    @Data
    @Schema(description = "HQChart - 分钟响应 VO")
    public static class MinuteRespVO {
        @Schema(description = "价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
        private BigDecimal price;
        @Schema(description = "这1分钟的开盘价", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
        private BigDecimal open;
        @Schema(description = "这1分钟的最高价", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
        private BigDecimal high;
        @Schema(description = "这1分钟的最低价", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
        private BigDecimal low;
        @Schema(description = "这1分钟的成交量", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
        private Integer vol;
        @Schema(description = "这1分钟的成交金额", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
        private BigDecimal amount;
        @Schema(description = "交易时间[Hmm]", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
        @JsonFormat(pattern = "Hmm")
        private LocalTime time;
        @Schema(description = "交易日期[yyyyMMdd]", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
        @JsonFormat(pattern = "yyyyMMdd")
        private LocalDate date;
        @Schema(description = "均价", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
        @JsonProperty("avprice")
        private BigDecimal avgPrice;
        @Schema(description = "涨幅(0.5 => 0.5%)", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.5")
        private BigDecimal increase;
        @Schema(description = "涨跌(0.2)", requiredMode = Schema.RequiredMode.REQUIRED, example = "0.2")
        @JsonProperty("risefall")
        private BigDecimal riseFall;
//        @Schema(description = "领先指标(指数才有)", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "")
//        private String lead;
//        @Schema(description = "持仓量(期货才有)", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "")
//        private String position;
//        @Schema(description = "昨结算价(期货才有)", requiredMode = Schema.RequiredMode.NOT_REQUIRED, example = "")
//        private String yclearing;
    }


}
